{%- assign slug = page.dir | replace: '/', '' -%}
{%- assign this = nil -%}
{%- for chapter in site.chapters -%}
  {%- if chapter.slug == slug -%}
    {%- assign this = chapter -%}
    {%- break -%}
  {%- endif -%}
{%- endfor -%}
<!DOCTYPE html>
<html lang="en">
  {% include head.html %}
  <body {% if page.draft %}class="draft"{% endif %}>
    {% include nav.html %}
    <div class="container content">
      {% include header.html this=this %}
      <main>
        <ul class="toc"></ul>
        {% include terms.html slug=slug %}
        {{ content }}
        {% if this.keypoints %}{% include keypoints.md points=this.keypoints %}{% endif %}
        {% if this.exercises %}{% include problems.md exercises=this.exercises %}{% endif %}
      </main>
      {% include foot.html %}
    </div>
  </body>
</html>
